from django.shortcuts import render, HttpResponse


# Create your views here.

def book_detail_query_string(request):
    book_id = request.GET.get('id')
    name = request.GET.get('name')
    # 上面这种写法如果请求路径中没有id会得到一个none，下面这个则会直接抛出异常
    # request.GET['id']
    return HttpResponse(f"您查找到图书id是： {book_id}, 图书名称是：{name}")


def book_detail_path(request, book_id):
    return HttpResponse(f"您查找到图书id是： {book_id}")


def book_str(request, book_id):
    return HttpResponse(f"您查找到图书id是： {book_id}")


def book_slug(request, book_id):
    return HttpResponse(f"您查找到图书id是： {book_id}")


def book_path(request, book_id):
    return HttpResponse(f"您查找到图书id是： {book_id}")
